import request from '@/utils/request'

// 换乘路径查询
export function searchTransfer(query) {
  return request({
    url: '/bus/transfer/search',
    method: 'get',
    params: query
  })
}

// 换乘路径查询（POST方式）
export function searchTransferPost(data) {
  return request({
    url: '/bus/transfer/search',
    method: 'post',
    data: data
  })
}

// 查询站点间距离预计算列表
export function listStationDistances(query) {
  return request({
    url: '/bus/transfer/distances',
    method: 'get',
    params: query
  })
}

// 查询可步行换乘的站点对
export function getWalkableStations() {
  return request({
    url: '/bus/transfer/walkable',
    method: 'get'
  })
}

// 查询指定站点的可换乘站点
export function getTransferableStations(fromStationId) {
  return request({
    url: '/bus/transfer/transferable/' + fromStationId,
    method: 'get'
  })
}

// 查询两个站点间的距离
export function getDistanceBetweenStations(fromStationId, toStationId) {
  return request({
    url: '/bus/transfer/distance/' + fromStationId + '/' + toStationId,
    method: 'get'
  })
}

// 重新计算站点间距离
export function recalculateStationDistances() {
  return request({
    url: '/bus/transfer/recalculate',
    method: 'post'
  })
}

// 获取指定站点详细信息
export function getStationDetail(stationId) {
  return request({
    url: '/bus/transfer/station/' + stationId,
    method: 'get'
  })
}

// 清空距离预计算表
export function clearStationDistances() {
  return request({
    url: '/bus/transfer/clear',
    method: 'delete'
  })
}

// 导出站点间距离数据
export function exportStationDistances(query) {
  return request({
    url: '/bus/transfer/export',
    method: 'post',
    params: query
  })
}